home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
(A)TA
/
(A)TAO.ADF
/
Utilities
/
Error.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-10
|
2KB
|
88 lines
/******************************************************************
*
* Copyright (C) 1988 Roy Kniskern
*
* You are free to use and distribute this code non-commercially (only).
*
* You may not charge more than reasonable cost of duplication and
* distribution for this code or its object without my written permission.
*
* Roy Kniskern
* 225 Briarwood Dr.
* Christiansburg, Va. 24073
*
* GEnie rkniskern
*
*******************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "myerrors.h"
#include <ctype.h>
#define ESC 27
#ifndef FALSE
#define FALSE 0
#define TRUE !FALSE
#endif
void main(argc,argv)
int argc;
char **argv;
{
int i,string2mark,addrflg=FALSE;
if((argc==1)||(argv[1][0]=='?'))
{
printf("DOS and GURU Meditation Error decoder\n");
printf("Written by Roy Kniskern 4/16/88\n");
printf(" Syntax - ERROR number\n");
printf(" Example - ERROR 103 or ERROR 82010002.2fee8604\n");
exit(0);
}
/* Is there a '.' in the error code (GURU ERROR?) */
for (string2mark=0;string2mark<strlen(argv[1]);string2mark++)
if(argv[1][string2mark]=='.')
{
argv[1][string2mark]='\0';
string2mark++;
addrflg=TRUE;
break;
}
printf("%c[33mERROR %s = ",ESC,argv[1]);
i=0;
while(1)
{
if(!strcmp(errors[i].error_no,argv[1]))
{
printf("%s",errors[i].error_msg);
break;
}
if(!strcmp(errors[i].error_no,"thats-all/folks"))
{
printf("--Sorry, that error not in table");
break;
}
i++;
}
if(addrflg)
{
printf("\n Address = %s",&argv[1][string2mark]);
for(i=string2mark; argv[1][i]!='\0'; i++)
if(!isxdigit(argv[1][i]))
{
printf(" (contains illegal character(s))");
break;
}
}
printf("%c[31m\n",ESC);
}